home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d7 / lib231.arc / SPUD-DL.SLT < prev    next >
Text File  |  1990-05-11  |  2KB  |  51 lines

  1. /////////////////////////////////////////////////////////////////
  2. main()
  3. {
  4.  cputs("OPEN 48^M");  // open door 48; replace w/proper door#
  5.  
  6.  // translation: put the string "OPEN 48<Enter>" out the comm.
  7.  // port (same as typing it manually online...)
  8.  
  9.  if (not waitfor("Deluxe Update Door", 120))
  10.   return(0);
  11.  
  12.  // translation: wait 120 seconds for the string "Deluxe
  13.  // Update Door" to come in, 'if' it doesn't come in,
  14.  // return() to 'the caller' (if called from a Custom Command, 
  15.  // 'the caller' is The Liberator).  You can break it down to
  16.  // three SALT functions: if(), waitfor(), and return().  A
  17.  // return() from main() always ends the current script.
  18.  
  19.  while (waitfor("Press any key to continue...", 8))
  20.   cputs("^M");
  21.  
  22.  // translation:  wait 8 seconds for the string "Press any key to
  23.  // continue..." to come in, and 'while' the string keeps coming
  24.  // in, put an <Enter> (^M) out the communications port.  This
  25.  // can also be broken down to three functions: while(),
  26.  // waitfor(), cputs().
  27.  
  28.  cputs("ALL^M"); // select ALL files for downloading (Door option)
  29.  delay_scr(20);  // delay for 20/10th's of a second, or 2 seconds
  30.  cputs("DOWNLOAD^M"); // send the door command to start the download
  31.  
  32.  if (waitfor("Begin your Zmodem download now...", 200))
  33.   receive('Z', "");
  34.  
  35.  // if the prompt "Begin your Zmodem download now..." comes in 
  36.  // within 200 seconds, then we start the download with the
  37.  // receive().  Otherwise we ignore the receive and continue
  38.  // below.  See the SALT manual for send/receive protocol
  39.  // letters.  Also note that the Zmodem protocol passes the
  40.  // filename (the BBS sends it with the file), so we don't have 
  41.  // to specify it in the receive() function--hence the "" where 
  42.  // the filename should be.  Receive() continues below when the
  43.  // download completes...
  44.  
  45.  waitfor("Command? ", 10); // pause for 10 seconds or until prompt
  46.  cputs("QUIT^M");          // then exit the door and...
  47.  waitfor("Command? ", 120);// waitfor PCBoard prompt to let The
  48.                            // Liberator continue.
  49. }
  50. /////////////////////////////////////////////////////////////////
  51.